from EmpVoting import NetworkModifier

from EmpVoting.Alg import AgentWeightLocalAlg
from EmpVoting.Alg import SwFromAgentWeightAlg


class SwLocalAlg(NetworkModifier):

    def __init__(self, useDynamicFields = False):
        '''
        Constructor
        '''
        self.useDynamicFields = useDynamicFields
        
    def Apply(self, network):
        AgentWeightLocalAlg(False).Apply(network)
        SwFromAgentWeightAlg(False).Apply(network)
        
        
        self.SetNetworkField(network, "alternativeSwDict", network.alternativeSwDict)
        self.SetNetworkField(network, "bestAlternative", network.bestAlternative)